<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Timer: TimerContext Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Timer
   &#160;<span id="projectnumber">2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_timer_context.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#pri-static-attribs">Static Private Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="class_timer_context-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">TimerContext Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;TimerContext.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a50467cf05052121d274a21d0cf1dfa58"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a50467cf05052121d274a21d0cf1dfa58">~TimerContext</a> ()</td></tr>
<tr class="separator:a50467cf05052121d274a21d0cf1dfa58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a973a2dc57fe6f7f5f3565344b126122c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a973a2dc57fe6f7f5f3565344b126122c">handleTick</a> ()</td></tr>
<tr class="separator:a973a2dc57fe6f7f5f3565344b126122c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:af5d68fb58caee3c99fcd6ea9cf58fc34"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_timer_context.html">TimerContext</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#af5d68fb58caee3c99fcd6ea9cf58fc34">instance</a> ()</td></tr>
<tr class="separator:af5d68fb58caee3c99fcd6ea9cf58fc34"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a75b75d19594b042fa66dc6525ade155f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a75b75d19594b042fa66dc6525ade155f">attach</a> (<a class="el" href="class_timer.html">Timer</a> *timer)</td></tr>
<tr class="separator:a75b75d19594b042fa66dc6525ade155f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04acdc651a095d35096282a2321d358e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a04acdc651a095d35096282a2321d358e">detach</a> (<a class="el" href="class_timer.html">Timer</a> *timer)</td></tr>
<tr class="separator:a04acdc651a095d35096282a2321d358e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr class="memitem:a122ce9672310449ecb8e4a55fa590ff1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a122ce9672310449ecb8e4a55fa590ff1">TimerContext</a> ()</td></tr>
<tr class="separator:a122ce9672310449ecb8e4a55fa590ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a82092fd905e02accb4ffa313ad680e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_timer_context.html">TimerContext</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a3a82092fd905e02accb4ffa313ad680e">operator=</a> (const <a class="el" href="class_timer_context.html">TimerContext</a> &amp;src)</td></tr>
<tr class="memdesc:a3a82092fd905e02accb4ffa313ad680e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Root node of single linked list containing the timers to be kicked.  <a href="#a3a82092fd905e02accb4ffa313ad680e">More...</a><br/></td></tr>
<tr class="separator:a3a82092fd905e02accb4ffa313ad680e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab87897f391fee6e238b9834e4182611a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#ab87897f391fee6e238b9834e4182611a">TimerContext</a> (const <a class="el" href="class_timer_context.html">TimerContext</a> &amp;src)</td></tr>
<tr class="separator:ab87897f391fee6e238b9834e4182611a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:a3e55a18f985b5f0ee7788bddfe88fdca"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_timer.html">Timer</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a3e55a18f985b5f0ee7788bddfe88fdca">m_timer</a></td></tr>
<tr class="memdesc:a3e55a18f985b5f0ee7788bddfe88fdca"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_timer.html">Timer</a> Context singleton instance variable.  <a href="#a3e55a18f985b5f0ee7788bddfe88fdca">More...</a><br/></td></tr>
<tr class="separator:a3e55a18f985b5f0ee7788bddfe88fdca"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-static-attribs"></a>
Static Private Attributes</h2></td></tr>
<tr class="memitem:a5d75e3bc303ccec24cbed132eb2349a8"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_timer_context.html">TimerContext</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a5d75e3bc303ccec24cbed132eb2349a8">s_instance</a> = (<a class="el" href="class_timer_context.html">TimerContext</a>*)0</td></tr>
<tr class="separator:a5d75e3bc303ccec24cbed132eb2349a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a50de43af5bed41f30c071d8cce0e81bc"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_timer_context.html#a50de43af5bed41f30c071d8cce0e81bc">Timer</a></td></tr>
<tr class="separator:a50de43af5bed41f30c071d8cce0e81bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="class_timer.html">Timer</a> Context.</p>
<p>Features:</p>
<ul>
<li>is like a very simple scheduler.</li>
<li>has to be kicked (by calling <a class="el" href="_timer_8cpp.html#a58c8b2ad0ea491a6642e5e1cbd358c89">yield()</a>, <a class="el" href="_timer_8cpp.html#a7f2364edc008cc2606f262114fece9f4">scheduleTimers()</a> or <a class="el" href="class_timer_context.html#a973a2dc57fe6f7f5f3565344b126122c">TimerContext::handleTick()</a>) as often as possible and/or on regular intervals, i.e. in the Arduino main loop() function: <pre class="fragment">#include "Timer.h"

void loop()
{
  // Kick the timer(s)
  yield();

  // .. do something
}
</pre></li>
<li>holds a single linked list of registered <a class="el" href="class_timer.html">Timer</a> objects, the Timers automatically attach themselves to this on their creation and automatically detach themselves on their destruction.</li>
<li>is a Singleton </li>
</ul>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a50467cf05052121d274a21d0cf1dfa58"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TimerContext::~TimerContext </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>

</div>
</div>
<a class="anchor" id="a122ce9672310449ecb8e4a55fa590ff1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TimerContext::TimerContext </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Constructor. </p>

</div>
</div>
<a class="anchor" id="ab87897f391fee6e238b9834e4182611a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TimerContext::TimerContext </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_timer_context.html">TimerContext</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a75b75d19594b042fa66dc6525ade155f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void TimerContext::attach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_timer.html">Timer</a> *&#160;</td>
          <td class="paramname"><em>timer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Add a <a class="el" href="class_timer.html">Timer</a> object to the single linked list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">timer</td><td><a class="el" href="class_timer.html">Timer</a> object pointer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a04acdc651a095d35096282a2321d358e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void TimerContext::detach </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_timer.html">Timer</a> *&#160;</td>
          <td class="paramname"><em>timer</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Remove specified <a class="el" href="class_timer.html">Timer</a> object from the single linked list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">timer</td><td><a class="el" href="class_timer.html">Timer</a> object pointer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a973a2dc57fe6f7f5f3565344b126122c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TimerContext::handleTick </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Kick all attached <a class="el" href="class_timer.html">Timer</a> objects (calls the <a class="el" href="class_timer.html#a6f4dc6b9e9f333fa4c60ddf2ff33c801">Timer::tick()</a> method). </p>

</div>
</div>
<a class="anchor" id="af5d68fb58caee3c99fcd6ea9cf58fc34"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_timer_context.html">TimerContext</a> * TimerContext::instance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Create and/or return singleton instance of <a class="el" href="class_timer.html">Timer</a> Context. </p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to singleton <a class="el" href="class_timer_context.html">TimerContext</a> object pointer. </dd></dl>

</div>
</div>
<a class="anchor" id="a3a82092fd905e02accb4ffa313ad680e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_timer_context.html">TimerContext</a>&amp; TimerContext::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_timer_context.html">TimerContext</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Root node of single linked list containing the timers to be kicked. </p>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a class="anchor" id="a50de43af5bed41f30c071d8cce0e81bc"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="class_timer.html">Timer</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a3e55a18f985b5f0ee7788bddfe88fdca"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_timer.html">Timer</a>* TimerContext::m_timer</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p><a class="el" href="class_timer.html">Timer</a> Context singleton instance variable. </p>

</div>
</div>
<a class="anchor" id="a5d75e3bc303ccec24cbed132eb2349a8"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_timer_context.html">TimerContext</a> * TimerContext::s_instance = (<a class="el" href="class_timer_context.html">TimerContext</a>*)0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>C:/git/test-workspaces/TimerTest/lib/plat/timer/Timer/<a class="el" href="_timer_context_8h.html">TimerContext.h</a></li>
<li>C:/git/test-workspaces/TimerTest/lib/plat/timer/Timer/<a class="el" href="_timer_context_8cpp.html">TimerContext.cpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_timer_context.html">TimerContext</a></li>
    <li class="footer">Generated on Thu Jun 26 2014 09:07:56 for Timer by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
